Context

During the performance measurement in Ticket PM-123, many recursive calls to the database were identified that could probably be the reason for the slow performance of the application.

Idea

With jQAssistant, it is possible to spot possible recursive code to our database layer (the classes that start with "Database")

Analysis


In [2]:
import pandas as pd
import py2neo

graph = py2neo.Graph()

query="""
MATCH (m:Method)-[:INVOKES*]->(m)
   -[:INVOKES]->(dbMethod:Method)
      <-[:DECLARES]-(dbClass:Class)
WHERE dbClass.name = "Database"
RETURN m.name as caller, dbClass.name + "." + dbMethod.name as dbMethod
"""

pd.DataFrame(graph.data(query))


Out[2]:
caller dbMethod
0 loadParent Database.loadThing

Result

The recursive calls in the listed caller columns should be further investigated and optimized.